<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="resource/js/jquery-2.0.3.js"></script>
</head>
<body>
	<h1>测试的JSP</h1>
	<div id="div1"></div>
	通过id查询员工信息<input type="text" name="position" id="position" value="1"><br>
	<span id="msg"></span><br>
	<button id="search">查找员工</button>
	<script type="text/javascript">
	$(function(){
        $("#search").on('click',function (event) {
            $.ajax({
                type:"get",//请求方式
                url:"PositionServlet?op=GetPosition",//请求地址
                data:{//数据接收
                "position":$("#position").val(),
                },
                dataType:'json',//数据类型
                success: function(type) {//点击成功以后调用的函数
					console.log(type);//控制台显示type
					$('#msg').html(type[0].positionname);//span#msg 控制台显示type
                }
            });
        });
    });
	</script>
</body>
</html>